From 75e202f02b8ad2ed546b12984197649373f62c28 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Timm=20B=C3=A4der?= Date: Wed, 29 Apr 2020 08:07:45 +0200 Subject: [PATCH] widget: Use an unchecked cast in _get_native() This is either no chagne because we know for a fact that the returned value is a GtkNative - after all thats's the type we pass to gtk_widget_get_ancestor(). Or it is a bug fix since casting NULL to a GtkNative using GTK_NATIVE() is not going to work, but the API contract of gtk_widget_get_native() explicitly allows a NULL return value. --- gtk/gtkwidget.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gtk/gtkwidget.c b/gtk/gtkwidget.c index 463d1319e7..c5dca9447d 100644 --- a/gtk/gtkwidget.c +++ b/gtk/gtkwidget.c @@ -6053,7 +6053,7 @@ gtk_widget_get_native (GtkWidget *widget) { g_return_val_if_fail (GTK_IS_WIDGET (widget), NULL); - return GTK_NATIVE (gtk_widget_get_ancestor (widget, GTK_TYPE_NATIVE)); + return (GtkNative *)gtk_widget_get_ancestor (widget, GTK_TYPE_NATIVE); } static void -- 2.30.2